#include <windows.h>
#include <stdio.h>



DWORD GetKernelBase()
{
	DWORD ret;
	__asm{
		mov eax,dword ptr fs:[30h]
		mov eax,dword ptr [eax+0Ch]
		mov ebx,dword ptr [eax+1Ch]
		mov ebx,dword ptr [ebx]
		mov esi,dword ptr [ebx+8h]  
		mov ret, esi
	}
	return ret;
}

DWORD asmtest()
{
}

int main(int argc, char* argv)
{
	printf("LoadLibrary : 0x%08X\n", LoadLibrary);
	printf("kernel32.dll address : 0x%08X\n", GetModuleHandleA("kernel32.dll"));
	printf("ntdll.dll address : 0x%08X\n", GetModuleHandleA("ntdll.dll"));
	printf("0x%08X\n", GetKernelBase());

	
	return 0;
}


